package com.demo.miya.service.seata.tcc;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface SeataTCCService {

    @TwoPhaseBusinessAction(name = "createUser", commitMethod = "commitMethod", rollbackMethod = "rollbackMethod", useTCCFence = true)
    void prepare(BusinessActionContext actionContext, Long userId, Long  sleepTime) throws InterruptedException;

    boolean commitMethod(BusinessActionContext actionContext);

    boolean rollbackMethod(BusinessActionContext parameterContext);
}
